/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;

/**
 *
 * @author Andrés Felipe
 */
public class SupplierXproduct implements Serializable {
    private static final long serialVersionUID = 1L;
    protected SupplierXproductPK supplierXproductPK;
    private int responsetime;
    private double price;
    private Supplier supplier;
    private Product product;

    public SupplierXproduct() {
    }

    public SupplierXproduct(SupplierXproductPK supplierXproductPK) {
        this.supplierXproductPK = supplierXproductPK;
    }

    public SupplierXproduct(SupplierXproductPK supplierXproductPK, int responsetime, double price) {
        this.supplierXproductPK = supplierXproductPK;
        this.responsetime = responsetime;
        this.price = price;
    }

    public SupplierXproduct(int supplierindentification, int productid) {
        this.supplierXproductPK = new SupplierXproductPK(supplierindentification, productid);
    }

    public SupplierXproductPK getSupplierXproductPK() {
        return supplierXproductPK;
    }

    public void setSupplierXproductPK(SupplierXproductPK supplierXproductPK) {
        this.supplierXproductPK = supplierXproductPK;
    }

    public int getResponsetime() {
        return responsetime;
    }

    public void setResponsetime(int responsetime) {
        this.responsetime = responsetime;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Supplier getSupplier() {
        return supplier;
    }

    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (supplierXproductPK != null ? supplierXproductPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SupplierXproduct)) {
            return false;
        }
        SupplierXproduct other = (SupplierXproduct) object;
        if ((this.supplierXproductPK == null && other.supplierXproductPK != null) || (this.supplierXproductPK != null && !this.supplierXproductPK.equals(other.supplierXproductPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.SupplierXproduct[ supplierXproductPK=" + supplierXproductPK + " ]";
    }
    
}
